package com.wudl.govern.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

/**
 * @author ：wudl
 * @date ：Created in 2022-04-05 13:33
 * @description：
 * @modified By：
 * @version: 1.0
 */

public class ControlRule extends PageBase {

    private Integer id;
    @NotNull(message = "数据源ｉｄ不能为空!")
    private Integer sourceId;
    @NotNull(message = "表不能为空!")
    private Integer tableId;
    //    @NotNull(message = "列名不能为空！")
    private Integer columnId;
    @NotBlank(message = "数据源名称不能为空!")
    private String sourceName;
    @NotBlank(message = "表名不能为空!")
    private String tableName;
    //    @NotBlank(message = "字段名不能为空!")
    private String columnName;
    @NotBlank(message = "规则名称不能为空!")
    @Size(max = 20,message = "规则名20字符以内")
    private String ruleName;
    @NotBlank(message = "规则类型不能为空!")
    private String ruleType;
    @Size(max = 100,message = "规则表达式长度不能超过100")
    private String ruleExpression;
    @Size(max = 50,message = "规则描述长度不能超过50")
    private String ruleDescribe;

    private String valRangeType;

    private String dictCodeSet;

    private String referenceStandard;

    private String createUser;

    private Date createDate;

    private String uppUser;

    private Date uppDate;

    private String dataType;

    private Integer dataState;

    private String filterSql;

    private Integer massRatio;

    private Integer notEmpty;

    private String columnIds;

    private String columnNames;

    private String deptId;

    /**及时性的规则*/
    private List filterRules;
    /**默认的规则*/
    private List defaultFilter;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSourceId() {
        return sourceId;
    }

    public void setSourceId(Integer sourceId) {
        this.sourceId = sourceId;
    }

    public Integer getTableId() {
        return tableId;
    }

    public void setTableId(Integer tableId) {
        this.tableId = tableId;
    }

    public Integer getColumnId() {
        return columnId;
    }

    public void setColumnId(Integer columnId) {
        this.columnId = columnId;
    }

    public String getSourceName() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName == null ? null : sourceName.trim();
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName == null ? null : tableName.trim();
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName == null ? null : columnName.trim();
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName == null ? null : ruleName.trim();
    }

    public String getRuleType() {
        return ruleType;
    }

    public void setRuleType(String ruleType) {
        this.ruleType = ruleType == null ? null : ruleType.trim();
    }

    public String getRuleExpression() {
        return ruleExpression;
    }

    public void setRuleExpression(String ruleExpression) {
        this.ruleExpression = ruleExpression == null ? null : ruleExpression.trim();
    }

    public String getRuleDescribe() {
        return ruleDescribe;
    }

    public void setRuleDescribe(String ruleDescribe) {
        this.ruleDescribe = ruleDescribe == null ? null : ruleDescribe.trim();
    }

    public String getValRangeType() {
        return valRangeType;
    }

    public void setValRangeType(String valRangeType) {
        this.valRangeType = valRangeType == null ? null : valRangeType.trim();
    }

    public String getDictCodeSet() {
        return dictCodeSet;
    }

    public void setDictCodeSet(String dictCodeSet) {
        this.dictCodeSet = dictCodeSet == null ? null : dictCodeSet.trim();
    }

    public String getReferenceStandard() {
        return referenceStandard;
    }

    public void setReferenceStandard(String referenceStandard) {
        this.referenceStandard = referenceStandard == null ? null : referenceStandard.trim();
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getUppUser() {
        return uppUser;
    }

    public void setUppUser(String uppUser) {
        this.uppUser = uppUser == null ? null : uppUser.trim();
    }

    public Date getUppDate() {
        return uppDate;
    }

    public void setUppDate(Date uppDate) {
        this.uppDate = uppDate;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType == null ? null : dataType.trim();
    }

    public Integer getDataState() {
        return dataState;
    }

    public void setDataState(Integer dataState) {
        this.dataState = dataState;
    }

    public String getFilterSql() {
        return filterSql;
    }

    public void setFilterSql(String filterSql) {
        this.filterSql = filterSql == null ? null : filterSql.trim();
    }

    public Integer getMassRatio() {
        return massRatio;
    }

    public void setMassRatio(Integer massRatio) {
        this.massRatio = massRatio;
    }

    public Integer getNotEmpty() {
        return notEmpty;
    }

    public void setNotEmpty(Integer notEmpty) {
        this.notEmpty = notEmpty;
    }

    public String getColumnIds() {
        return columnIds;
    }

    public void setColumnIds(String columnIds) {
        this.columnIds = columnIds == null ? null : columnIds.trim();
    }

    public String getColumnNames() {
        return columnNames;
    }

    public void setColumnNames(String columnNames) {
        this.columnNames = columnNames == null ? null : columnNames.trim();
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public List getFilterRules() {
        return filterRules;
    }

    public void setFilterRules(List filterRules) {
        this.filterRules = filterRules;
    }

    public List getDefaultFilter() {
        return defaultFilter;
    }

    public void setDefaultFilter(List defaultFilter) {
        this.defaultFilter = defaultFilter;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ControlRule that = (ControlRule) o;
        return that.id.equals(this.id);
    }

    @Override
    public int hashCode() {

        return this.id.hashCode();
    }
}